package com.bkgy.modularbx.coil_prod_stats.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.List;

/**
 * 缺陷原因损失重量统计结果DTO
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(description = "缺陷原因损失重量统计结果DTO")
public class DefectReasonResultDTO {

    /**
     * 缺陷原因
     */
    @Schema(description = "缺陷原因")
    private String defectReason;

    /**
     * 缺陷原因编码
     */
    @Schema(description = "缺陷原因编码")
    private String defectReasonCode;

    /**
     * 损失重量(吨)
     */
    @Schema(description = "损失重量(吨)")
    private BigDecimal lossWeight;

    /**
     * 缺陷原因重量(吨)
     */
    @Schema(description = "缺陷原因重量(吨)")
    private BigDecimal totalWeight;
    /**
     * 总重量(吨)
     */
    @Schema(description = "生产总重量(吨)")
    private BigDecimal totalAllWeight;

    /**
     * 损失比例(%)
     */
    @Schema(description = "损失比例(%)")
    private BigDecimal lossRatio;
    
    /**
     * 统计时间
     */
    @Schema(description = "统计时间")
    private String statsTime;

    @Schema(description = "对应机组集合")
    private String crews;

    /**
     * 缺陷原因统计响应（包含集合与切分建议）
     */
    @Data
    @Schema(description = "缺陷原因损失统计响应")
    public static class DefectReasonResponse {
        @Schema(description = "统计结果集合")
        private List<DefectReasonResultDTO> resultList;

        @Schema(description = "左侧切分建议")
        private String leftSplitSuggestion;

        @Schema(description = "右侧切分建议")
        private String rightSplitSuggestion;
    }

}